package com.pingan.haofang.searchcloud.common.form;

import com.pingan.haofang.searchcloud.common.constants.Constants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

/**
 * 分页form
 *
 * @author LUYI374
 * @date 2017年2月16日
 * @since 1.0.0
 */
@ApiModel
public class PageForm {

    @NotNull(message = "page.pageNo.illegal")
    @Range(min = 1, max = Integer.MAX_VALUE, message = "page.pageNo.illegal")
    @ApiModelProperty(value = "页码", allowableValues = "range[1,infinity]", required = true)
    private Integer pageNo;

    @NotNull(message = "page.pageNo.illegal")
    @Range(min = 1, max = Constants.MAX_PAGE_SIZE, message = "page.pageSize.illegal")
    @ApiModelProperty(value = "每页显示记录数", allowableValues = "range[1,infinity]", required = true)
    private Integer pageSize;

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
}
